$(function(){

	// 贫困占比图
	var poorNum = "5";
    var PovertyRatio = echarts.init(document.getElementById('PovertyRatio'));
    var PovertyRatiooption = {
            color: ['#00a9cc','#c7eaee'],
            yAxis: [
                {
                    show: false
                }
            ],
            title: {
		        text: poorNum + "%",
		        x: 'center',
		        y: 'center',
		        textStyle: {
		            fontWeight: 'normal',
		            color: "#0bb6f0",
		            fontSize: 30
		        }
		    },
            series: [
                {
                    center: [
                        '50%',
                        '50%'
                    ],
                    radius: [
                        '100%',
                        '90%'
                    ],
                    hoverAnimation: false,
                    type: 'pie',
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [{
                        value: poorNum,   //占比值
                        name: poorNum + '%', //显示百分比
                        label: {
                            normal: {
                                position: 'center',
                                show: true,
                                textStyle: {
                                    fontSize: '30',
                                    fontWeight: 'bold',
                                    color: '#fff'
                                }
                            }
                        }
                    }, {
                        value: 100 - poorNum,
                        name: ''
                    }
                    ]
                }
            ]
        };
    PovertyRatio.setOption(PovertyRatiooption);

// 贫困类型分布情况
	var poorType = echarts.init(document.getElementById('poorType'));
	var  poorTypeoption = {
		title : {
            text : ""
        },
        tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
	    // legend: {
	    //     data:['贫困人口','贫困户']
	    // },
	    grid: {
	    	top: '5%',
	        left: '3%',
	        right: '4%',
	        bottom: '8%',
	        containLabel: true
	    },	    
	    calculable : true,
	    xAxis : [
	        {
	            // type : 'category',
	            data : ['一般贫困户','低保贫困户','五保贫困户'],
                // "axisLabel":{
		        //     interval: 0
		        // }
	        }
	    ],
	    yAxis : [
	        {
	            type : 'value'
	        }
	    ],
	    series : [
	        {
	            name:'贫困类型',
	            type:'bar',
	            data:[35,27,63],
	            barWidth : 15,
	            itemStyle:{
                    normal:{
                        color:'#0681e8'
                    }
                },
	        }
	    ]
	};
	poorType.setOption(poorTypeoption);

	// 致贫原因图
	var WhyPoor = echarts.init(document.getElementById('WhyPoor'));
	var WhyPooroption = {
	    tooltip: {
	        trigger: 'item',
	        formatter: "{a} <br/>{b}: {c} ({d}%)"
	    },
	    grid: {
	    	top: '2%',
	        left: '2%',
	        right: '2%',
	        bottom: '2%',
	        containLabel: true
	    },	 
	    // legend: {
	    //     orient: 'vertical',
	    //     x: 'left',
	    //     data:['疾病','懒惰','残疾','赌博']
	    // },
	    series: [
	        {
	            name:'致贫原因',
	            type:'pie',
	            radius: ['65%', '90%'],
	            avoidLabelOverlap: false,
	            label: {
	                normal: {
	                    show: false,
	                    position: 'center'
	                },
	                emphasis: {
	                    show: true,
	                    textStyle: {
	                        fontSize: '16',
	                        fontWeight: 'bold'
	                    }
	                }
	            },
	            labelLine: {
	                normal: {
	                    show: false
	                }
	            },
	            data:[
	                {value:335, name:'因学',itemStyle:{normal:{color:'#0359a2'}},},
	                {value:310, name:'因灾',itemStyle:{normal:{color:'#027fb9'}},},
	                {value:234, name:'大病',itemStyle:{normal:{color:'#028ebf'}},},
	                {value:135, name:'慢病',itemStyle:{normal:{color:'#029dc9'}},},
                    {value:124, name:'缺劳力',itemStyle:{normal:{color:'#04aac0'}},},
                    {value:264, name:'缺资金',itemStyle:{normal:{color:'#03a6a3'}},},
                    {value:174, name:'其他',itemStyle:{normal:{color:'#03c6a3'}},}
	            ]
	        }
	    ]
	};
	WhyPoor.setOption(WhyPooroption);

// 帮扶记录图
	var AidRecord = echarts.init(document.getElementById('AidRecord'));
	var AidRecordoption = {
	    tooltip: {
	        trigger: 'axis'
	    },
	    grid: {
	        left: '3%',
	        right: '3%',
	        top: '3%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: {
	        type: 'category',
	        boundaryGap: false,
	        data: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月']
	    },
	    yAxis: {
	        type: 'value'
	    },
	    series: [
	        {
	            name:'帮扶次数',
	            type:'line',
	            stack: '总量',
	            data:[120, 132, 101, 134, 90, 230,134, 90, 230, 210],
	            itemStyle:{
                    normal:{
                        color:'#f4c51f'
                    }
                },
	        }
	    ]
	};
	AidRecord.setOption(AidRecordoption);

// 满意度统计图
	var SatisfactionStatistics = echarts.init(document.getElementById('SatisfactionStatistics'));
	var SatisfactionStatisticsoption = {
		title : {
	            text : ""
	        },
	        tooltip : {
	        trigger: 'axis',
	        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
	            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    grid: {
	    	top: '5%',
	        left: '3%',
	        right: '4%',
	        bottom: '8%',
	        containLabel: true
	    },	    
	    calculable : true,
	    xAxis : [
	        {
	            // type : 'category',
	            data : ['不满意','较差','一般','挺满意','很满意'],
			            "axisLabel":{  
		            interval: 0  
		        }  
	        }
	    ],
	    yAxis : [
	        {
	            type : 'value'
	        }
	    ],
	    series : [
	        {
	            name:'满意程度',
	            type:'bar',
	            data:[35,27,63,34,66,34],
	            barWidth : 15,
	            itemStyle:{
                    normal:{
                        color:'#f4c51f'
                    }
                },
	        }
	    ]
	};
	SatisfactionStatistics.setOption(SatisfactionStatisticsoption);

	// 资金走势图
	var FundTrend = echarts.init(document.getElementById('FundTrend'));
	var FundTrendoption = {
	    tooltip: {
	        trigger: 'axis'
	    },
	    grid: {
	        left: '3%',
	        right: '3%',
	        top: '3%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: {
	        type: 'category',
	        boundaryGap: false,
	        data: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月']
	    },
	    yAxis: {
	        type: 'value'
	    },
	    series: [
	        {
	            name:'资金走势',
	            type:'line',
	            stack: '总量',
	            data:[220, 152, 161, 184, 190, 230,164, 190, 162, 450],
	            itemStyle:{
                    normal:{
                        color:'#f4c51f'
                    }
                },
	        }
	    ]
	};
	FundTrend.setOption(FundTrendoption);

	// 项目落实图
	var PINum = "45";
    var ProjectImplementation = echarts.init(document.getElementById('ProjectImplementation'));
    var ProjectImplementationoption = {
            color: ['#f4c51f','#f8e7a2'],
            yAxis: [
                {
                    show: false
                }
            ],
            title: {
		        text: PINum + "%",
		        x: 'center',
		        y: 'center',
		        textStyle: {
		            fontWeight: 'normal',
		            color: "#0bb6f0",
		            fontSize: 30
		        }
		    },
            series: [
                {
                    center: [
                        '50%',
                        '50%'
                    ],
                    radius: [
                        '100%',
                        '70%'
                    ],
                    hoverAnimation: false,
                    type: 'pie',
                    labelLine: {
                        normal: {
                            show: false
                        }
                    },
                    data: [{
                        value: PINum,   //占比值
                        name: PINum + '%', //显示百分比
                        label: {
                            normal: {
                                position: 'center',
                                show: true,
                                textStyle: {
                                    fontSize: '30',
                                    fontWeight: 'bold',
                                    color: '#fff'
                                }
                            }
                        }
                    }, {
                        value: 100 - PINum,
                        name: ''
                    }
                    ]
                }
            ]
        };
    ProjectImplementation.setOption(ProjectImplementationoption);

    // 贫困人口走势图
	var PoorTrend = echarts.init(document.getElementById('PoorTrend'));
	var PoorTrendoption = {
	    tooltip: {
	        trigger: 'axis'
	    },
	    grid: {
	        left: '3%',
	        right: '3%',
	        top: '3%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: {
	        type: 'category',
	        boundaryGap: false,
	        data: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月']
	    },
	    yAxis: {
	        type: 'value'
	    },
	    series: [
	        {
	            name:'资金走势',
	            type:'line',
	            stack: '总量',
	            data:[548, 382, 351, 384, 284, 270, 424, 352, 270, 210],
	            itemStyle:{
                    normal:{
                        color:'#008fbf'
                    }
                },
	        }
	    ]
	};
	PoorTrend.setOption(PoorTrendoption);

// 收入增加走势图
	var IncomeTrend = echarts.init(document.getElementById('IncomeTrend'));
	var IncomeTrendoption = {
	    tooltip: {
	        trigger: 'axis'
	    },
	    grid: {
	        left: '3%',
	        right: '3%',
	        top: '3%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: {
	        type: 'category',
	        boundaryGap: false,
	        data: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月']
	    },
	    yAxis: {
	        type: 'value'
	    },
	    series: [
	        {
	            name:'资金走势',
	            type:'line',
	            stack: '总量',
	            data:[220, 162, 131, 154, 190, 230,164, 190, 230, 168],
	            itemStyle:{
                    normal:{
                        color:'#f4c51f'
                    }
                },
	        }
	    ]
	};
	IncomeTrend.setOption(IncomeTrendoption);

})